package com.shuang.controller;

import java.util.HashMap;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.shuang.pojo.DbGoodsDescribe;
import com.shuang.service.DbGoodsDescribeService;

@Controller
@RequestMapping("/describe")
public class DbGoodsDescribeHanlder {

	@Resource(name="dbGoodsDescribeService")
	private DbGoodsDescribeService  dbGoodsDescribeService;
	
	@RequestMapping("/getDescribeInfoById")
	@ResponseBody
	public Map<String,Object> getDescribeInfoById(@RequestParam(value="id") Long gId){
		if(gId==null){
			Map<String,Object> map=new HashMap<String, Object>();
			map.put("status", 403);
			map.put("data", "参数不完整");
		}
		
		return dbGoodsDescribeService.getDescribeInfoById(gId);
		
	}
	@RequestMapping("/updateDescribeInfoById")
	@ResponseBody
	public Map<String,Object> updateDescribeInfoById(DbGoodsDescribe dbGoodsDescribe ){
		if(dbGoodsDescribe==null){
			Map<String,Object> map=new HashMap<String, Object>();
			map.put("status", 403);
			map.put("data", "参数不完整");
		}
		
		return dbGoodsDescribeService.updateDescribeInfoById(dbGoodsDescribe);
		
	}
}
